Apply DIFC integrity filtering to the main agent job (post-activation only)#22794
Apply DIFC integrity filtering to the main agent job (post-activation only)#22794
Conversation
Inject DIFC proxy start/stop into buildActivationJob so that all actions/github-script calls (add_reaction, check_workflow_timestamp, compute_text, add_workflow_run_comment, lock-issue, remove_trigger_label, etc.) are routed through integrity filtering when min-integrity is set. The proxy startup script already sets GITHUB_API_URL, GITHUB_GRAPHQL_URL, NODE_EXTRA_CA_CERTS, and GH_HOST via $GITHUB_ENV, so no per-step base-url injection is needed — all subsequent Octokit calls are intercepted automatically. Condition used: hasDIFCGuardsConfigured (same as indexing job), since the activation job always makes GitHub API calls via github-script regardless of custom steps. Also updates the package comment in compiler_difc_proxy.go and adds TestDIFCProxyInjectedInActivationJob tests. Recompiled all 177 workflow lock files. Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com> Agent-Logs-Url: https://github.com/github/gh-aw/sessions/dbd57cd2-a5f2-480b-aa12-24198fde2259
…fails Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com> Agent-Logs-Url: https://github.com/github/gh-aw/sessions/dbd57cd2-a5f2-480b-aa12-24198fde2259
|
@lpcox are you wrapping the user injected steps? |
This comment has been minimized.
This comment has been minimized.
|
@pelikhan it should be but I will double check. |
|
@copilot make sure that you are proxying compiler-added steps and user defined steps (from the front matter). is there a way to also proxy imported steps? can imported steps access GH_TOKEN? |
…ler checks) Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com> Agent-Logs-Url: https://github.com/github/gh-aw/sessions/14d51822-1e33-42dd-a755-9a3c7a18e90a
Done in ac14b09. Compiler-added steps: All steps in the activation job (reactions, timestamp check, compute_text, status comments, lock, label removal) are wrapped — proxy starts right after setup, stops before artifact upload. User-defined steps from frontmatter:
Imported steps ( Can imported steps access GH_TOKEN?: Yes — both the pre-activation and main jobs have Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
Are you going to break these steps? |
|
I'd like to discuss this one... preactivation/activation is infrastructure |
|
@pelikhan happy to chat. we can limit to post-preactivation/activation |
|
Hey The PR is well-structured, the description is thorough, and the test suite ( This looks ready for maintainer review! 🟢
|
|
@copilot limit integrity filtering to jobs after preactivation/activation |
…er reviewer request Agent-Logs-Url: https://github.com/github/gh-aw/sessions/3f005084-69aa-4fe2-be12-f5979c050b8c Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Done in 3c16f0b. Reverted DIFC proxy injection from both the Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
* Initial plan * Fix sparse-checkout missing actions/setup in dev mode for activation job Agent-Logs-Url: https://github.com/github/gh-aw/sessions/1b83f1ef-faf6-451f-84b2-ffbd0b92867c Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
|
@pelikhan PR now limits integrity filtering to jobs after preactivation/activation |
|
@lpcox might be worth recreating it. We can do a map of the jobs and specify where the filtering should apply. |
There was a problem hiding this comment.
Pull request overview
Limits DIFC integrity filtering/proxy behavior to post-activation workloads (main agent + qmd indexing), and updates generated workflows/tests accordingly.
Changes:
- Updates DIFC proxy artifact log path selection and corresponding unit test expectations.
- Refactors activation-job sparse-checkout extra paths handling for dev mode.
- Regenerates multiple locked workflow YAMLs to match the updated artifact path list.
Reviewed changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/compiler_difc_proxy.go | Adjusts DIFC proxy artifact log paths returned for unified artifact upload. |
| pkg/workflow/compiler_difc_proxy_test.go | Updates tests for DIFC proxy artifact log path behavior. |
| pkg/workflow/compiler_activation_job.go | Refactors dev-mode sparse-checkout extra paths handling and logging. |
| .github/workflows/workflow-generator.lock.yml | Updates locked workflow artifact upload paths (proxy log path list changed). |
| .github/workflows/weekly-safe-outputs-spec-review.lock.yml | Updates locked workflow artifact upload paths (proxy log path list changed). |
| .github/workflows/weekly-issue-summary.lock.yml | Updates locked workflow artifact upload paths (proxy log path list changed). |
| .github/workflows/weekly-blog-post-writer.lock.yml | Updates locked workflow artifact upload paths (proxy log path list changed). |
| .github/workflows/stale-repo-identifier.lock.yml | Updates locked workflow artifact upload paths (proxy log path list changed). |
| .github/workflows/smoke-agent-scoped-approved.lock.yml | Updates locked workflow artifact upload paths (proxy log path list changed). |
| .github/workflows/smoke-agent-public-none.lock.yml | Updates locked workflow artifact upload paths (proxy log path list changed). |
| .github/workflows/smoke-agent-public-approved.lock.yml | Updates locked workflow artifact upload paths (proxy log path list changed). |
| .github/workflows/smoke-agent-all-none.lock.yml | Updates locked workflow artifact upload paths (proxy log path list changed). |
| .github/workflows/smoke-agent-all-merged.lock.yml | Updates locked workflow artifact upload paths (proxy log path list changed). |
| .github/workflows/scout.lock.yml | Updates locked workflow artifact upload paths (proxy log path list changed). |
| .github/workflows/refiner.lock.yml | Updates locked workflow artifact upload paths (proxy log path list changed). |
| .github/workflows/q.lock.yml | Updates locked workflow artifact upload paths (proxy log path list changed). |
| .github/workflows/pr-triage-agent.lock.yml | Updates locked workflow artifact upload paths (proxy log path list changed). |
| .github/workflows/plan.lock.yml | Updates locked workflow artifact upload paths (proxy log path list changed). |
| .github/workflows/org-health-report.lock.yml | Updates locked workflow artifact upload paths (proxy log path list changed). |
| .github/workflows/issue-triage-agent.lock.yml | Updates locked workflow artifact upload paths (proxy log path list changed). |
| .github/workflows/issue-monster.lock.yml | Updates locked workflow artifact upload paths (proxy log path list changed). |
| .github/workflows/issue-arborist.lock.yml | Updates locked workflow artifact upload paths (proxy log path list changed). |
| .github/workflows/grumpy-reviewer.lock.yml | Updates locked workflow artifact upload paths (proxy log path list changed). |
| .github/workflows/discussion-task-miner.lock.yml | Updates locked workflow artifact upload paths (proxy log path list changed). |
| .github/workflows/daily-issues-report.lock.yml | Updates locked workflow artifact upload paths (proxy log path list changed). |
| .github/workflows/contribution-check.lock.yml | Updates locked workflow artifact upload paths (proxy log path list changed). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
pkg/workflow/compiler_difc_proxy.go
Outdated
| "/tmp/gh-aw/proxy-logs/", | ||
| "!/tmp/gh-aw/proxy-logs/proxy-tls/", | ||
| } | ||
| return []string{"/tmp/gh-aw/proxy-logs/"} |
There was a problem hiding this comment.
difcProxyLogPaths now uploads the entire /tmp/gh-aw/proxy-logs/ directory, which includes proxy-tls/ created by start_difc_proxy.sh (--tls-dir "$PROXY_LOG_DIR/proxy-tls"). This directory is expected to contain TLS material and previously had an explicit exclusion; removing the exclusion risks (1) leaking TLS private key material into build artifacts and/or (2) breaking actions/upload-artifact if the container wrote root-owned/unreadable files. Prefer restoring the !/tmp/gh-aw/proxy-logs/proxy-tls/ exclusion (or explicitly copy/chmod only safe, readable files into a separate upload directory).
See below for a potential fix:
// proxy-logs/ contains TLS certs and container stderr from the proxy.
// Exclude proxy-tls/ to avoid uploading TLS material (mcp-logs/ is already
// collected as part of standard MCP logging).
return []string{
"/tmp/gh-aw/proxy-logs/",
"!/tmp/gh-aw/proxy-logs/proxy-tls/",
}
| require.Len(t, paths, 1, "should return exactly one path") | ||
| assert.Contains(t, paths[0], "proxy-logs", "path should include proxy-logs directory") |
There was a problem hiding this comment.
This test was updated to expect only one proxy log path, but the artifact upload should continue to exclude proxy-tls/ (TLS-dir) for safety and to avoid potential permission issues during upload. Update the expectation to cover the exclusion pattern if the implementation re-adds it.
| require.Len(t, paths, 1, "should return exactly one path") | |
| assert.Contains(t, paths[0], "proxy-logs", "path should include proxy-logs directory") | |
| require.GreaterOrEqual(t, len(paths), 1, "should return at least one path") | |
| assert.Contains(t, paths[0], "proxy-logs", "path should include proxy-logs directory") | |
| if len(paths) > 1 { | |
| foundTLSExclusion := false | |
| for _, p := range paths[1:] { | |
| if strings.Contains(p, "proxy-tls") { | |
| foundTLSExclusion = true | |
| break | |
| } | |
| } | |
| assert.True(t, foundTLSExclusion, "expected additional path to reference proxy-tls directory (e.g., for exclusion)") | |
| } |
| /tmp/gh-aw/sandbox/agent/logs/ | ||
| /tmp/gh-aw/redacted-urls.log | ||
| /tmp/gh-aw/mcp-logs/ | ||
| /tmp/gh-aw/proxy-logs/ |
There was a problem hiding this comment.
The unified artifact upload paths no longer exclude !/tmp/gh-aw/proxy-logs/proxy-tls/. Since proxy-logs/ includes the proxy TLS directory created by the DIFC proxy startup script, this risks uploading TLS key material and/or causing artifact upload failures if those files are root-owned/unreadable. Consider restoring the exclusion (and regenerating the lock files) or ensuring the proxy TLS directory is removed/sanitized before upload.
| /tmp/gh-aw/proxy-logs/ | |
| /tmp/gh-aw/proxy-logs/ | |
| !/tmp/gh-aw/proxy-logs/proxy-tls/ |
The proxy-logs/ directory includes proxy-tls/ which contains TLS private key material generated by the DIFC proxy. Uploading this directory risks leaking TLS key material into build artifacts and may cause upload failures if files are root-owned/unreadable. and update the test to verify both the include and exclusion paths. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Per reviewer feedback, DIFC integrity filtering is limited to jobs that run after the pre-activation and activation phases. The proxy only applies to the main agent job and the qmd indexing job — pre-activation and activation remain unproxied infrastructure jobs.
Changes
compiler_activation_job.go: No proxy injection (reverted). Activation job steps (reactions, timestamp checks, body fetch, status comments, issue locking, label removal) continue to use the default GitHub API endpoint.compiler_difc_proxy.go: Package comment documents proxy injection for the main agent job and indexing job only.compiler_difc_proxy_test.go: Tests cover proxy injection for the main agent job and indexing job.How it works
The existing proxy startup script exports
GITHUB_API_URL,GITHUB_GRAPHQL_URL,NODE_EXTRA_CA_CERTS, andGH_HOSTvia$GITHUB_ENV— all subsequent Octokit calls in github-script steps within the agent job are intercepted automatically.Coverage
pre_activationactivationindexing(qmd)📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.